/*******************************************************************
 * Copyright (C) yel_hb-USTC, 2012                                
 *                                                                  
 * FILE NAME             :  dmvector.h                                 
 * PRINCIPAL AUTHOR      :  yel_hb                               
 * MODULE NAME           :  VECTOR                             
 * LANGUAGE              :  C++                                      
 * TARGET ENVIRONMENT    :  windows                                   
 * DATE OF FIRST RELEASE :  2012/12/14                              
 * DESCRIPTION           :  Vector class definition 
 ******************************************************************/

/*
 * Revision log:
 *
 * Created by yel_hb,2012/12/14
 * Modified by yel_hb,2012/12/18
 *
 */

#ifndef DMVECTOR_H     
#define DMVECTOR_H    1

#include <vector>
using namespace std;

class DMVector
{
public:
	DMVector ( int n );
	DMVector();
	void fill ( double value );
	double get ( int i ) const;
	double get ( vector<double>::iterator ix ) const;
	void set ( int i, double value );
	void add ( const DMVector& v);
	void sub ( const DMVector& v);
	void mul ( double k );
	void inc_mul ( const DMVector& v, double k );
	double dot ( const DMVector& v );
	double square_norm ();
	double norm ();
	double sum ();
	double min ();
	double max ();
	int size ();
	~DMVector ();
private:
	vector<double>	vlist;
};

#endif